package com.ruoyi.common.constant;

import java.util.HashMap;
import java.util.Map;

public class BusinessConstants {

    // 单选
    public static final Integer QUESTION_SINGLE_CHOOSE = 1;
    // 多选
    public static final Integer QUESTION_MULTIPLE_CHOOSE = 2;
    // 填空
    public static final Integer QUESTION_COMPLETION = 3;
    // 判断
    public static final Integer QUESTION_JUDGE = 4;

    // 用户交卷类型
    public static final String MEMBER_TEST_PAPER_SUBMIT_TYPE_EXAM = "1";
    // 批改试卷提交类型
    public static final String MEMBER_TEST_PAPER_SUBMIT_TYPE_CORRECT = "2";
    // 试卷需要人工打分
    public static final Integer MEMBER_TEST_PAPER_CORRECT_YES = 1;
    // 试卷不需要人工打分
    public static final Integer MEMBER_TEST_PAPER_CORRECT_NO = 0;

    public static final String MEMBER_TEST_PAPER_REDIS_KEY_PREFIX = "planMemberId_";

    public static final String COMMON_YES = "1";
    public static final String COMMON_NO = "0";
    public static final Integer COMMON_YES_INTEGER = 1;
    public static final Integer COMMON_NO_INTEGER = 0;

    public static final String IMPORT_QUESTION_TYPE_NAME_MUST = "固定题";
    public static final String IMPORT_QUESTION_TYPE_NAME_RANDOM = "随机题";

    // 0.未及格  1.及格  2.考试中 3.未考试
    public static final Integer PLAN_MEMBER_STATUS_NOT_PASS = 0;
    public static final Integer PLAN_MEMBER_STATUS_PASSED = 1;
    public static final Integer PLAN_MEMBER_STATUS_DOING = 2;
    public static final Integer PLAN_MEMBER_STATUS_NOT_START = 3;

    // 新增、删除、修改标记
    public static final Integer COMMON_ADD = 1;
    public static final Integer COMMON_UPDATE = 2;
    public static final Integer COMMON_DELETE = 3;

    // 问卷调查 未开始 已开始 已完成
    public static final Integer SURVEY_NOT_START = 1;
    public static final Integer SURVEY_HAS_START = 2;
    public static final Integer SURVEY_HAS_DONE = 3;

    // 1培训计划消息2考试信息3问卷调查信息4通知公告
    public static final Integer MESSAGE_TYPE_SEND = 1;
    public static final Integer MESSAGE_TYPE_NOT_SEND = 0;

    public static Integer getQuestionType(String typeName) {
        Map<String, Integer> typesMap = new HashMap<>();
        typesMap.put("单选题", 1);
        typesMap.put("多选题", 2);
        typesMap.put("填空题", 3);
        typesMap.put("判断题", 4);
        return typesMap.get(typeName);
    }

    public static String getQuestionTypeName(Integer type) {
        Map<Integer, String> typesMap = new HashMap<>();
        typesMap.put(1, "单选题");
        typesMap.put(2, "多选题");
        typesMap.put(3, "填空题");
        typesMap.put(4, "判断题");
        return typesMap.get(type);
    }

    public static String getAnswerFormat(String typeName) {
        Map<String, String> typesMap = new HashMap<>();
        typesMap.put("A", "1");
        typesMap.put("B", "2");
        typesMap.put("C", "3");
        typesMap.put("D", "4");
        typesMap.put("E", "5");
        typesMap.put("F", "5");
        return typesMap.get(typeName);
    }

    public static String getAnswer(Integer type) {
        Map<Integer, String> typesMap = new HashMap<>();
        typesMap.put(1, "A");
        typesMap.put(2, "B");
        typesMap.put(3, "C");
        typesMap.put(4, "D");
        typesMap.put(5, "E");
        typesMap.put(6, "F");
        return typesMap.get(type);
    }
}
